$ () ->
	countBmi = () ->
		if $("#height").val() != ''
			if $("#weight").val() != ''
				_tempHeight = $("#height").val()/100
				_temp = _tempHeight*_tempHeight
				temp = ($("#weight").val() / _temp).toFixed(1)
				return temp

	$("#height").blur (e) ->
		$("#bmi").val(countBmi())

	$("#weight").blur (e) ->
		$("#bmi").val(countBmi())

	$(".btn_div").click (e) ->
		param =
			id: $("#id").val()
			name: $("#name").val()
			phone: $("#phone").val()
			height: $("#height").val()
			weight: $("#weight").val()
			bmi: $("#bmi").val()
			dis_age: $("#dis_age").val()

		$.post "/api/user/update-user-info", param, (res) ->
			if res.status.errCode is 0
				alert "修改成功"
			else
				alert res.status.message